<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.web.vo.PmsUserVo"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>天气详情</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
String f_wf_id =request.getParameter("f_wf_id");

%>
<script type="text/javascript">
	$(function() {
		  
	}); 
	$(function() {
		var f_wf_id = <%=f_wf_id%>;
		$.ajax({
			url:"../../weather_forecast/select_weather.do?f_wf_id="+f_wf_id,
			success:function(data) {
				data = JSON.parse(data);
				$("#f_wf_id").val(data.f_wf_id);
				
				/* var areaArr = (data.f_wf_cityid).split("-");
				$("#prov").html(provice[areaArr[0]].name);
				$("#city").html(provice[areaArr[0]].city[areaArr[1]].name);
				$("#country").html(provice[areaArr[0]].city[areaArr[1]].districtAndCounty[areaArr[2]]); 
				 */
				$("#f_wf_minTemperature").html(data.f_wf_minTemperature);
				$("#f_wf_maxTemperature").html(data.f_wf_maxTemperature);
				$("#f_wf_weather").html(data.f_wf_weather);
				$("#f_wf_date").html(data.f_wf_date);
				$("#f_wf_userarea").html(data.f_wf_userarea_name);
				
			}
	    }); 
		$("#contentForm").validate({
			rules: {
				f_wf_userarea: {
					required: true
				},
				f_wf_minTemperature:{
					required:true
				},
				f_wf_maxTemperature:{
					required:true
				},
				f_wf_weather:{
					required:true
				},
				f_wf_date:{
					required:true
				}
				
			},
			messages: {
				f_wf_userarea: {
					required: "请选择地区"
				},
				f_wf_minTemperature:{
					required:"请填写最低气温"
				},
				f_wf_maxTemperature:{
					required:"请填写最高气温"
				},
				f_wf_weather:{
					required:"请填写天气状况"
				},
				f_wf_date:{
					required:"请填写天气当天时间"
				}
			}
			
		});
	});

	function _submitFm() {
		
		if($("#contentForm").validate().form()) {
			app_ajax('../../weather_forecast/update_weather.do', $("#contentForm").serialize(), function(data) {
					if (data.success) {
						$.messager.progress('close');
						$.messager.alert('提示', '提交成功！', 'info', function() {
							parent.$('#dlg').dialog('close');
							parent.gotoSearch($('#easyui-treegrid'));
						});
					} else {
						$.messager.alert('提示', data.result, 'info', function() {
							$.messager.progress('close');
						});
					}
			});
	  }
	}
	
	function getAddress(){
		var prov = $("#prov").val();
		var city = $("#city").val();
		var country = $("#country").val();
		var str="";
		str = prov+"-"+city+"-"+country;
		return str;
	}
</script>
<style type="text/css">
</style>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：天气预报管理 &gt; 天气详情</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container-1">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input name="f_wf_id" id="f_wf_id" type="hidden" onkeydown="onpress();" />
					<legend style="text-align: center; margin: 0 auto;">天气详情</legend>
					<fieldset >
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>地区：
									</td>
									<td width="30%">
										<font id="f_wf_userarea" style="width: 150px;"></font>
										<span id="f_wf_userarea_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<!-- <fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>城市：
									</td>
									<td width="30%">
										<font id="prov" style="width: 80px;"></font>
										<font id="city" style="width: 80px;"></font>
										<font id="country" style="width: 80px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset> -->
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>时间：
									</td>
									<td width="30%">
									    <font id="f_wf_date" style="width: 150px;"></font>
										<span id="f_wf_date_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>最低气温/℃：
									</td>
									<td width="30%">
										<font id="f_wf_minTemperature" style="width: 150px;"></font>
										<span id="f_wf_minTemperature_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>最高气温/℃：
									</td>
									<td width="30%">
										<font id="f_wf_maxTemperature" style="width: 150px;"></font>
										<span id="f_wf_maxTemperature_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
								    <td width="20%" align="right">
										<span class="red">*</span>天气状况：
									</td>
									<td width="30%">
										<font id="f_wf_weather" style="width: 150px;"></font>
										<span id="f_wf_weather_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<div class="toolbar" style="text-align: center;">
						<!-- <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							href="javascript:void(0);" onclick="_submitFm()">保存</a>  -->
							<a href="javascript:void(0);" data-options="iconCls:'icon-cancel'" class="easyui-linkbutton" onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
					</div>
				</form>
			</div>
		</div>
		<!--主体 结束-->
	</div>
	<div id="org_list" class="easyui-dialog"
		style="width: 600px; height: 500px; padding-top: 0px;"
		data-options="title:'客户选择', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
</body>
<!-- <script type="text/javascript" src="../../static/js/city/city.js"></script>
<script type="text/javascript" src="../../static/js/city/method01.js"></script> -->
</html>
